package com.binance.mbxgateway.api;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.binance.master.configs.FeignConfig;
import com.binance.master.constant.Constant;
import com.binance.master.models.APIRequest;
import com.binance.master.models.APIResponse;
import com.binance.mbxgateway.vo.PriceConvertVo;
import com.binance.mbxgateway.vo.request.AddProductRequest;
import com.binance.mbxgateway.vo.request.CreateAssetRequest;
import com.binance.mbxgateway.vo.request.IceicebergLimitRequest;
import com.binance.mbxgateway.vo.request.NumAlgoOrdersRequest;
import com.binance.mbxgateway.vo.request.OrderTypeRequest;
import com.binance.mbxgateway.vo.request.PriceConvertRequest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api
@FeignClient(name = Constant.MBX_GATEWAY_SERVICE, configuration = FeignConfig.class)
public interface IProductApi {

    @PostMapping("/product/priceConvert")
    @ApiOperation(notes = "价格转换", nickname = "priceConvert", value = "价格转换")
    public APIResponse<PriceConvertVo> priceConvert(@RequestBody APIRequest<PriceConvertRequest> request)
            throws Exception;

    @ApiOperation("设置某个交易对的下单频率")
    @PostMapping(value = "/mgmt/setNumOrders", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public APIResponse<Void> setNumAlgoOrdersFilter(@RequestBody APIRequest<NumAlgoOrdersRequest> request)
            throws Exception;

    @ApiOperation("设置冰山单拆分数量")
    @PostMapping(value = "/mgmt/setIceicebergLimit", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public APIResponse<Void> setIceicebergLimit(@RequestBody APIRequest<IceicebergLimitRequest> request)
            throws Exception;

    @ApiOperation("设置下单类型")
    @PostMapping(value = "/mgmt/setProductType", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public APIResponse<Void> setProductType(@RequestBody APIRequest<OrderTypeRequest> request) throws Exception;

    @ApiOperation("添加产品")
    @PostMapping(value = "/mgmt/addProduct", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public APIResponse<Void> addProduct(@RequestBody APIRequest<AddProductRequest> request) throws Exception;

    @ApiOperation("创建Asset")
    @PostMapping(value = "/mgmt/creatAsset", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public APIResponse<Void> creatAsset(@RequestBody APIRequest<CreateAssetRequest> request) throws Exception;
}
